Trilium supports simple backup scheme where it saves copy of the Database on these events:
So in total you'll have at most 4 backups from different points in time
which should protect you from various problems. These backups are stored
by default in backup directory placed in
the data directory.
This is only very basic backup solution, and you're encouraged to add some better backup solution - e.g. backing up the Database to cloud / different computer etc.
Note that Synchronization provides also some backup capabilities by its nature of distributing the data to other computers.
Let's assume you want to restore the weekly backup, here's how to do it:
~/trilium-data as data directory
from now on~/trilium-data/backup/backup-weekly.db -
this is the Database backup~/trilium-data/document.db,
~/trilium-data/document.db-waland ~/trilium-data/document.db-shm (latter
two files are auto generated)~/trilium-data/backup/backup-weekly.db to
~/trilium-data/document.db
chmod 600 document.db
If you have configured sync then you need to do it across all members of the sync cluster, otherwise older version (restored backup) of the document will be detected and synced to the newer version.
Although this is not recommended, it is possible to disable backup in
config.iniin the data directory:
[General]
... some other configs
# set to true to disable backups (e.g. because of limited space on server)
noBackup=true
You can also review the configuration file
to provide all config.ini values as environment
variables instead.
See sample config.